package org.flexlancer.databases
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;

	public class Users extends EventDispatcher
	{
		public function Users(target:IEventDispatcher=null)
		{
			super(target);
		}
		public static function VerifyUser ( parmUser:String, parmPassword:String):Boolean{
			try{
				var arr:Array = DatabaseManager.Manager.Select("users",null,"userid LIKE '"+parmUser+"' AND userpassword LIKE '"+parmPassword+"' ");
				if ( arr.length < 1 ) return false;
				else return true;
			}catch(err:Error){
				throw err;
			}
			return false;
		}
		public static function AddUser(parmUserid:String , parmPassword:String):void{
			try{
				var insertObj:Object = new Object();
				
				insertObj.userid = " '" +parmUserid+ "' ";
				insertObj.userpassword = " '"+parmPassword+"' ";

				DatabaseManager.Manager.Insert("users",insertObj);
			}catch(err:Error){
				throw err;
			}
		}
		public static function GetUserList():void{
			
		}
		public static function DeleteUser():void{
			
		}
		public static function UpdateUser():void{
			
		}
	}
}